﻿cmake_minimum_required(VERSION 3.0)

SET(SOLUTION_NAME OEQTDLL)

PROJECT(${SOLUTION_NAME})

# 指定自定义cmake脚本，在CMakeModules文件夹下
SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")

# 查找OSG库
FIND_PACKAGE(OSG)
INCLUDE_DIRECTORIES(${OSG_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
LINK_DIRECTORIES(${OSG_LIB_DIR})

# 查找OSGEARTH库
FIND_PACKAGE(OSGEARTH)
INCLUDE_DIRECTORIES(${OSGEARTH_INCLUDE_DIR})
LINK_DIRECTORIES(${OSGEARTH_LIB_DIR})

# 查找第三方依赖库
FIND_PACKAGE(3rdParty)
IF(3rd_FOUND)
	SET(3rd_INCLUDE_DIR ${3rd_DIR}/include)
	SET(3rd_LIB_DIR ${3rd_DIR}/lib)
	INCLUDE_DIRECTORIES(${3rd_INCLUDE_DIR})
	LINK_DIRECTORIES(${3rd_LIB_DIR})
ENDIF()

# 查找Qt5库。Qt5Widgets_DIR一般选择类似D:\Qt\Qt5.11.0\5.11.0\msvc2017_64\lib\cmake\Qt5Widgets目录
FIND_PACKAGE(Qt5Widgets QUIET)
IF(Qt5Widgets_FOUND)
	#SET(QT_INCLUDE_DIR ${Qt5Widgets_INCLUDE_DIRS} ${Qt5OpenGL_INCLUDE_DIRS})
ENDIF()

# 设置Debug版本和Release版本下库文件的后缀名
SET(CMAKE_DEBUG_POSTFIX "d")
SET(CMAKE_RELEASE_POSTFIX "")

ADD_SUBDIRECTORY(app)
ADD_SUBDIRECTORY(osgEarthWidgetDLL)